import axios, { AxiosInstance, AxiosRequestConfig } from 'axios'

const ajaxUrl = 'http://10.20.5.146:9010'
const ajaxUrlUser = 'http://10.20.5.7:9090'

class Util {
    public ajax: AxiosInstance
    public ajaxUser: AxiosInstance
    constructor(options: AxiosRequestConfig, optionsUser: AxiosRequestConfig) {
        this.ajax = axios.create(options)
        this.ajaxUser = axios.create(optionsUser)
    }
}
let util = new Util(
    {
        baseURL: ajaxUrl,
        timeout: 30000,
        withCredentials: true
    },
    {
        baseURL: ajaxUrlUser,
        timeout: 30000,
        withCredentials: true
    }
)

export default util